<?php
/**

 * User:ayou chow
 * Date: 2019-11-27
 * Time: 10:50
 */

namespace app\common\model;


use think\Model;

class OrderModel extends Model
{
    public function user(){
        return $this->hasOne('UserModel','id','uid')->with('profile')->field("id, nick_name, avatar");
    }

    public function userobj(){
        return $this->hasOne('UserModel','id','uid');
    }


    public static function getPayStatusTextAttr($value,$data) {
        $status = [0 => '等待支付', 1 => '支付成功', 2 => '支付取消', 3 => '支付失败'];
        return $status[$data['pay_status']];
    }
}